Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-45005: In Prompt Processing, use microservice to check for already-arrived Rubin images #192

Merged
merged 7 commits into from
Aug 30, 2024

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Aug 21, 2024

This PR adds support for the raw image microservice added on DM-39022. The service is optional; if it is not initialized, the code will behave as it did previously.

@kfindeisen kfindeisen force-pushed the tickets/DM-45005 branch 3 times, most recently from 457dee0 to db85f4b Compare August 22, 2024 18:40
@kfindeisen kfindeisen marked this pull request as ready for review August 22, 2024 18:40
@kfindeisen kfindeisen requested a review from ktlim August 22, 2024 18:48
raise RuntimeError("Could not query raw microservice.") from e

if unpacked["error"]:
raise RuntimeError("Raw microservice had an unidentified error.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If error is True, there will be a message element that gives more information (the exception that occurred in the server).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is message just a string? (An actual documented spec would be nice, BTW.)

python/activator/raw.py Show resolved Hide resolved
python/activator/raw.py Outdated Show resolved Hide resolved
Use of `moto.mock_aws` by itself can lead to authentication errors. The
lsst.resources.s3utils.clean_test_environment_for_s3 context provides a
clean slate to run in.
The mocks were previously only used for testing LSST cameras' sidecars,
but upcoming HSC tests will test check_for_snap, which is bucket-based.
This decouples check_for_snap from the contents of activator.py. The
behavior is unchanged. (Unfortunately, tbe boto3 API does not have a
useful Bucket object, and making a proxy isn't worth it.)
check_for_snap is much more tightly coupled to the raws code (paths,
parsing, etc.) than to the activator (bucket access). The activator is
still responsible for initializing the S3 client.
The microservice tracks metadata for images that have been recently
ingested, providing a backup for the bucket notifications.
The microservice maps metadata to filenames without requiring that the
latter be a deterministic function of the former, which for Rubin
instruments it isn't.
@kfindeisen kfindeisen merged commit d13b678 into main Aug 30, 2024
5 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-45005 branch August 30, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants